XendAPIStore - do not remove non-existent item
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 11:57:17 +0000 (11:57 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 4 Feb 2009 11:57:17 +0000 (11:57 +0000)
If list is searched and item not found, then don't attempt to delete
the item.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
tools/python/xen/xend/XendAPIStore.py

index 372509d695034621282e4294df6cfcfa3a479aae..dc313717dd66f43fa4c5bb89313c26c1e9c75298 100644 (file)
@@ -33,7 +33,8 @@ def register(uuid, type, inst):
 
 def deregister(uuid, type):
     old = get(uuid, type)
-    del __classes[(uuid, type)]
+    if old is not None:
+        del __classes[(uuid, type)]
     return old
 
 def get(uuid, type):